A single taxpayer's income of $24,000 or more but less than or equal to $58,150 falls into the 28% tax bracket.
' 28% Tax Bracket tester ' PRINT "Enter income" INPUT INCOME IF INCOME >= 24000 AND INCOME <= 58150 THEN PRINT "28 percent tax bracket" ELSE PRINT "some other tax bracket" END IF ' END
The AND
combines the results of two relational expressions.
This looks like:
INCOME >= 24000 AND INCOME <= 58150 ------------- --------------- relational relational expression expression
Each relational expression must be complete. The following is a MISTAKE:
INCOME >= 24000 AND <= 58150 ------------- --------------- relational not a expression relational expression
In this INCORRECT logical expression, the characters that follow the AND do not form a complete relational expression. QBasic will complain if you entered the program this way.
Here is an incorrect logical expression that is supposed to test if a person's age is between 21 and 35.
AGE >= 21 AND <= 35
Fix this logical expression.